package com.hotelvip.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.hotelvip.common.utils.EnumUtil;
import com.hotelvip.entity.VipUser;
import com.hotelvip.enumEntity.FlagEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author Lzh
 * @date 2020/12/15 16:57
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Accessors(chain = true)
@ApiModel(value = "vip客户用户vo对象",description = "vip客户用户对象VipUserVo")
public class VipUserVoWUYONG {
    @ApiModelProperty(value = "vip客户用户对象",name = "vipUser")
    private VipUser vipUser;
    @ApiModelProperty(value = "是否返现",name = "cashBackText")
    private Integer cashBackText;
    @ApiModelProperty(value = "是否可以转让",name = "makeOverText")
    private Integer makeOverText;

    public String getCashBackText(){
        if (vipUser.getCashBack()==null || EnumUtil.getByindex(vipUser.getCashBack(), FlagEnum.class)==null)
            return "";
        return EnumUtil.getByindex(vipUser.getCashBack(), FlagEnum.class).getName();
    }
    public String getMakeOverText(){
        if (vipUser.getMakeOver()==null || EnumUtil.getByindex(vipUser.getMakeOver(), FlagEnum.class)==null)
            return "";
        return EnumUtil.getByindex(vipUser.getMakeOver(), FlagEnum.class).getName();
    }

}
